// Bootstrap Wysiwyg Editor
// --------------------------------------------------

.wysiwyg-editor {
	max-height: 250px;
	height: 250px;
	background-color: @white;
	border-collapse: separate;
	border: 1px solid @default-border-color; 
	padding: 4px; 
	box-sizing: content-box; 
	overflow-y: scroll;
	overflow-x:hidden;
	outline: none;
	
	&:focus {
		background-color:@white;
	}
}


.wysiwyg-toolbar {
	line-height: 33px;
	position: relative;
	
	.dropdown-menu {
		text-align: left;
	}
	
	.btn-group {
		float: none !important;//to override .RTL's
		font-size: 0;
	}

	.btn-group > .btn {
		float: none;

		padding-left: 0;
		padding-right: 0;
		text-align: center;
		margin-left: 1px;
		
		.box-shadow (none)!important;
		
		> .fa, .glyphicon { margin: 0 4px;}
		> .fa:first-child, .glyphicon:first-child {
			font-size: 14px;
			width: 25px;
			max-width: 25px;
			display: inline-block;
			border-width: 1px !important;
		}
		&.dropdown-toggle > .fa:last-child,  &.dropdown-toggle > .glyphicon:last-child {
			margin-right: 4px;
		}
	}
}

.editor-style1 {
	background: @white;
	border: 1px solid @default-border-color;
	border-bottom: 0 none;
}
.editor-style1 , .editor-style2 {
	.btn-group > .btn , .btn-group > .inline > .btn {
		margin: 0 !important;
		background: @white !important;
		border-width: 0 !important;
		text-shadow: none !important;
		.box-shadow (none)!important;
		
		&.active {
			color: @themeColor !important;
			&:after {
				display: none;
			}
		}
	}
	
	.btn-group {
		position:relative;
		&:after {
			display: block;
			content: "";
			position: absolute;
			left: -2px; 
			top: 6px;
			bottom:6px;
			width: 0;
			max-width: 0;
			border-left:1px solid @default-border-color;
		}
		&:first-child:after {
			display:none;
		}
	}

	&.wysiwyg-toolbar {
		margin: 0 !important;
	}
}


.editor-style2 {
	background-color:@gray-lighter;
	border: 1px solid @default-border-color;
	border-bottom: 0 none;
	
	& + .wysiwyg-editor {
		border-color:@default-border-color;
		background-color:@white;
	}
	
	.btn-group > .btn , .btn-group > .inline > .btn  {
		margin:0 1px 0 0 !important;
		background:@white !important;
		border:1px solid @default-border-color!important;
		text-shadow:none !important;
		
		&.active  {
			color:@themeColor !important;
			
			&:after {
				display: none;
			}
		}
	}
	.btn-group:after {
		display:none;
	}
	
}




.wysiwyg-toolbar {
	.btn-colorpicker {
		width: 24px;
		height: 24px;
		position: relative;

		background: @themeColor; /* Old browsers */
		background: -moz-linear-gradient(top, #CF3E73 10%, @white 20%, #2283C5 30%, @white 40%, #87B87F 50%, @white 60%, #FFB752 70%, @white 80%, #D15B47 90%, @white 100%); /*  FF3.6+ */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(10%,#CF3E73), color-stop(20%,@white), color-stop(30%,#2283C5), color-stop(40%,@white), color-stop(50%,#87B87F), color-stop(60%,@white), color-stop(70%,#FFB752), color-stop(80%,@white), color-stop(90%,#D15B47), color-stop(100%,@white)); /* Chrome,Safari4+ */
		background: -webkit-linear-gradient(top, #CF3E73 10%, @white 20%, #2283C5 30%, @white 40%, #87B87F 50%, @white 60%, #FFB752 70%, @white 80%, #D15B47 90%, @white 100%); /* Chrome10+,Safari5.1+ */
		background: -o-linear-gradient(top, #CF3E73 10%, @white 20%, #2283C5 30%, @white 40%, #87B87F 50%, @white 60%, #FFB752 70%, @white 80%, #D15B47 90%, @white 100%); /* Opera11.10+ */
		background: -ms-linear-gradient(top, #CF3E73 10%, @white 20%, #2283C5 30%, @white 40%, #87B87F 50%, @white 60%, #FFB752 70%, @white 80%, #D15B47 90%, @white 100%); /* IE10+ */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CF3E73', endColorstr='#FFB752',GradientType=0 ); /* IE6-9 */
		background: linear-gradient(top, #CF3E73 10%, @white 20%, #2283C5 30%, @white 40%, #87B87F 50%, @white 60%, #FFB752 70%, @white 80%, #D15B47 90%, @white 100%); /* W3C */
	}
	.dropdown-colorpicker > .dropdown-menu {
		top: auto;
	}

	input[type=file]  {
		position: fixed;
		z-index: -10;
		opacity: 0;
		//inside modals the z-index:-10 does not work as expected
		max-width: 0;
		max-height: 0;
		display: block;
	}
	.wysiwyg-choose-file {
		display:inline-block;
		width:auto;
		margin:4px auto 0;
		padding-left:5px;
		padding-right:5px;
	}
	.dropdown-menu {
		input[type=text] {
			margin-left:8px;
			margin-bottom:0;
			&.form-control {
				min-width: 150px;
			}
		}
		.btn {
			margin-right: 8px;
			margin-left: 8px;
		}
	}
}
.editor-style1 .btn-colorpicker {
	width: 20px;
	height: 20px;
	margin-left: 4px;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
 /* for adding image resize functionality in chrome and safari */
 .wysiwyg-editor {
	img {
		display:inline !important;
	}
	.ui-wrapper {
	  border:1px dotted #D00;
	  overflow:visible !important;/* because it's image only, so it's ok */
	  display:inline-block !important;
	  vertical-align:middle;
	  &:after {
		  content:"";
		  display:block;
		  position:absolute;
		  right:-3px; bottom:-3px;
		  width:7px; height:7px;
		  border:1px solid #D00;
		  background-color:@white;
		  z-index:1;
	   }
	}
 }
}
